// Copyright 2017 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef __APP_AES_H__
#define __APP_AES_H__

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
	aes-ctr encrypt
	input
	inlen
	output  output string use base64 encode
	out_len
	return 0 suzzess,else fail
	
*/
int app_aes_encrypt(const char *input, size_t inlen, char **output, size_t *out_len, const char *key, const char *iv);
int app_aes_encrypt_bytes(const char *input, size_t inlen, char **output, size_t *out_len, const char *key, const char *iv);

/*
	aes-ctr encrypt
	input input string use base64 encode
	inlen
	output  
	out_len
	return 0 suzzess,else fail
	
*/
int app_aes_decrypt(const char *input, size_t inlen, char **output, size_t *out_len, const char *key, const char *iv);
int app_aes_decrypt_bytes(const char *input, size_t inlen, char **output, size_t *out_len, const char *key, const char *iv);
#ifdef __cplusplus
}
#endif

#endif /**< __APP_AES_H__ */